package com.woniuxy.api;

import com.woniu.cloud.common.dto.Result;
import com.woniuxy.form.InsertServiceOrderDetail;
import org.checkerframework.checker.index.qual.GTENegativeOne;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "kaer-order",contextId = "ServiceOrderDetailApi")
public interface ServiceOrderDetailApi {
    /**
     *
     * @param insertServiceOrderDetail
     * @return
     *
     * 插入服务订单详情
     *
     */
    @PostMapping("/insertServiceOrderDetail")
    Result insertServiceOrderDetail(@RequestBody InsertServiceOrderDetail insertServiceOrderDetail);

    /**
     *
     * @param indexPage 页数
     * @return
     *
     * 平台查看所有服务订单详情
     *
     */
    @GetMapping("/getServiceOrderDetailByPlatform")
    Result getServiceOrderDetailByPlatform(@RequestParam("indexPage") Integer indexPage);

    /**
     *
     * @param storeId 店铺Id
     * @param indexPage　页数
     * @return
     *
     * 店铺查看服务订单详情
     */
    @GetMapping("/getServiceOrderDetailByStore")
    Result getServiceOrderDetailByStore(@RequestParam("storeId") Integer storeId,@RequestParam("indexPage") Integer indexPage);

    /**
     *
     * @param userId 用户id
     * @param indexPage 页数
     * @param serviceOrderId 某个服务订单的订单详情
     * @return
     *
     * 用户查看服务订单详情
     */
    @GetMapping("/getServiceOrderDetailByUser")
    Result getServiceOrderDetailByUser(@RequestParam("userId") Integer userId,@RequestParam("indexPage") Integer indexPage,@RequestParam("serviceOrderId") Integer serviceOrderId);

    /**
     *
     * @param serviceOrderDetailId 服务详情订单id
     * @param statues 修改的状态  0:已消费  1:未消费  2:待验收
     * @return
     */
    @PutMapping("/updateServiceOrderDetailStatus")
    Result updateServiceOrderDetailStatus(@RequestParam("serviceOrderDetailId") Integer serviceOrderDetailId ,@RequestParam("statues") Integer statues);

    @GetMapping("/getServiceOrderDetailByProductOrderId")
    Result getServiceOrderDetailByProductOrderId(@RequestParam("serviceOrderId") Integer serviceOrderId);
}
